Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 29, 2025

Migrates all 22 component files from constructor-based dependency injection to Angular's modern inject() function pattern, following the reference implementation in microting/eform-backendconfiguration-plugin#608.

Changes

Pattern Migration

  • Replaced constructor DI parameters with field-level inject() calls
  • Moved constructor initialization logic to ngOnInit() where appropriate
  • Migrated @Inject(MAT_DIALOG_DATA) decorators to typed inject<Type>(MAT_DIALOG_DATA) pattern

Before:

constructor(
  private service: MyService,
  @Inject(MAT_DIALOG_DATA) data: MyModel
) {
  this.initializeData(data);
}

After:

private service = inject(MyService);
private data = inject<MyModel>(MAT_DIALOG_DATA);

ngOnInit() {
  this.initializeData(this.data);
}

Components Updated

  • Settings & Layout (2)
  • Installations (3)
  • Trash Inspections (2)
  • Segments (3)
  • Producers (4)
  • Transporters (4)
  • Fractions (4)

Bug Fix

Fixed pre-existing type mismatch in transporter-import.component.ts where TransporterPnImportModel was incorrectly instantiated as ProducerPnImportModel.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/microting/eform-backendconfiguration-plugin/pulls/608
    • Triggering command: /usr/bin/curl curl -s -H Accept: application/vnd.github.v3&#43;json REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Migrate all components from constructor-based DI to inject() pattern</issue_title>
<issue_description>Use this PR as reference for all the parts that needs to be taken into consideration when doing the migration microting/eform-backendconfiguration-plugin#608</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] Migrate all components from constructor-based DI to inject pattern Migrate components from constructor-based DI to inject() pattern Nov 29, 2025
Copilot AI requested a review from renemadsen November 29, 2025 05:28
Copilot finished work on behalf of renemadsen November 29, 2025 05:28
@renemadsen renemadsen marked this pull request as ready for review November 29, 2025 05:37
@renemadsen renemadsen merged commit 8bcf97e into master Nov 29, 2025
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate all components from constructor-based DI to inject() pattern

3 participants